# Contributor: Nico de Haer <nico.dehaer@gmail.com>
# Maintainer: Nico de Haer <nico.dehaer@gmail.com>
pkgname=pimd
pkgver=3.0_git20220201
_gitrev=facecc14c46fb0991d458664c650a7141dec035d
pkgrel=0
pkgdesc="PIM-SM/SSM Multicast Routing for UNIX"
url="https://troglobit.com/pimd.html"
arch="all"
options="!check"
license="BSD-3-Clause"
makedepends="linux-headers automake autoconf"
subpackages="$pkgname-doc $pkgname-openrc"
source="
	$pkgname-$_gitrev.tar.gz::https://github.com/troglobit/pimd/archive/$_gitrev.tar.gz
	pimd.initd
	pimd.confd
	"
builddir="$srcdir/$pkgname-$_gitrev"

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
	install -m644 -D "$builddir"/pimd.conf \
		"$pkgdir"/etc/pimd.conf
}

sha512sums="
87124ce25e4a5d31843cf397e8f6309078dbcf2b80fdfe4dafc539e52c31e362591314ae77b57302ab616237f9e6f945eb6b72178c090d1e2a136f0633b77b21  pimd-facecc14c46fb0991d458664c650a7141dec035d.tar.gz
e1858b511a4fea2bee743c2a9158c05844451ebb9ba3c23de257f7f25144a3671c04b32a37afdd158483ed9079427d00d25e314aabd0d83d44ba7e32da698166  pimd.initd
a0602071a27483dd955805e1eb885896626968ba7caba8e66ecdcc03244f4346cb3bc9c06e1da81e35c560f0d6c6622cbd52c190bae9088eaedae5d7f795acfc  pimd.confd
"
